Specify the tissue of interest, run the boilerplate code which sets up the functions and environment, load the tissue object.
tissue_of_interest = "Heart"
library(here)
source(here("00_data_ingest", "02_tissue_analysis_rmd", "boilerplate.R"))
tiss=load_tissue_droplet(tissue_of_interest)
Performing log-normalization
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
[1] "Scaling data matrix"
|
| | 0%
|
|================================================================================| 100%
Calculating gene means
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variance to mean ratios
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
Visualize top genes in principal components
Later on (in FindClusters and TSNE) you will pick a number of principal components to use. This has the effect of keeping the major directions of variation in the data and, ideally, supressing noise. There is no correct answer to the number to use, but a decent rule of thumb is to go until the plot plateaus.
PCElbowPlot(object = tiss)
Choose the number of principal components to use.
# Set number of principal components.
n.pcs = 9
The clustering is performed based on a nearest neighbors graph. Cells that have similar expression will be joined together. The Louvain algorithm looks for groups of cells with high modularity–more connections within the group than between groups. The resolution parameter determines the scale…higher resolution will give more clusters, lower resolution will give fewer.
For the top-level clustering, aim to under-cluster instead of over-cluster. It will be easy to subset groups and further analyze them below.
# Set resolution
res.used <- 0.5
tiss <- FindClusters(object = tiss, reduction.type = "pca", dims.use = 1:n.pcs,
resolution = res.used, print.output = 0, save.SNN = TRUE)
To visualize
# If cells are too spread out, you can raise the perplexity. If you have few cells, try a lower perplexity (but never less than 10).
tiss <- RunTSNE(object = tiss, dims.use = 1:n.pcs, seed.use = 10, perplexity=30, dim.embed = 2)
# note that you can set do.label=T to help label individual clusters
TSNEPlot(object = tiss, do.label = T)
Check expression of genes of interset.
Dotplots let you see the intensity of exppression and the fraction of cells expressing for each of your genes of interest.
How big are the clusters?
table(tiss@ident)
0 1 2 3 4 5 6
177 135 87 81 63 60 21
Which markers identify a specific cluster?
clust.markers <- FindMarkers(object = tiss, ident.1 = 2, ident.2 = 1, only.pos = TRUE, min.pct = 0.25, thresh.use = 0.25)
| | 0 % ~calculating
|+ | 1 % ~03s
|++ | 2 % ~03s
|++ | 3 % ~03s
|+++ | 4 % ~03s
|+++ | 5 % ~03s
|++++ | 6 % ~03s
|++++ | 7 % ~03s
|+++++ | 9 % ~03s
|+++++ | 10% ~03s
|++++++ | 11% ~03s
|++++++ | 12% ~03s
|+++++++ | 13% ~03s
|+++++++ | 14% ~02s
|++++++++ | 15% ~02s
|++++++++ | 16% ~02s
|+++++++++ | 17% ~02s
|++++++++++ | 18% ~02s
|++++++++++ | 19% ~02s
|+++++++++++ | 20% ~02s
|+++++++++++ | 21% ~02s
|++++++++++++ | 22% ~02s
|++++++++++++ | 23% ~02s
|+++++++++++++ | 24% ~02s
|+++++++++++++ | 26% ~02s
|++++++++++++++ | 27% ~02s
|++++++++++++++ | 28% ~02s
|+++++++++++++++ | 29% ~02s
|+++++++++++++++ | 30% ~02s
|++++++++++++++++ | 31% ~02s
|++++++++++++++++ | 32% ~02s
|+++++++++++++++++ | 33% ~02s
|++++++++++++++++++ | 34% ~02s
|++++++++++++++++++ | 35% ~02s
|+++++++++++++++++++ | 36% ~02s
|+++++++++++++++++++ | 37% ~02s
|++++++++++++++++++++ | 38% ~02s
|++++++++++++++++++++ | 39% ~02s
|+++++++++++++++++++++ | 40% ~02s
|+++++++++++++++++++++ | 41% ~02s
|++++++++++++++++++++++ | 43% ~02s
|++++++++++++++++++++++ | 44% ~02s
|+++++++++++++++++++++++ | 45% ~02s
|+++++++++++++++++++++++ | 46% ~02s
|++++++++++++++++++++++++ | 47% ~01s
|++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|+++++++++++++++++++++++++ | 50% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|+++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|++++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|+++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|+++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|+++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|+++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|++++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 03s
print(x = head(x= clust.markers, n = 10))
You can also compute all markers for all clusters at once. This may take some time.
tiss.markers <- FindAllMarkers(object = tiss, only.pos = TRUE, min.pct = 0.25, thresh.use = 0.25)
| | 0 % ~calculating
|+ | 1 % ~11s
|++ | 2 % ~10s
|++ | 3 % ~10s
|+++ | 4 % ~09s
|+++ | 5 % ~09s
|++++ | 6 % ~09s
|++++ | 7 % ~09s
|+++++ | 8 % ~09s
|+++++ | 9 % ~09s
|++++++ | 10% ~09s
|++++++ | 11% ~09s
|+++++++ | 12% ~09s
|+++++++ | 13% ~09s
|++++++++ | 14% ~09s
|++++++++ | 15% ~09s
|+++++++++ | 16% ~09s
|+++++++++ | 18% ~09s
|++++++++++ | 19% ~09s
|++++++++++ | 20% ~09s
|+++++++++++ | 21% ~08s
|+++++++++++ | 22% ~08s
|++++++++++++ | 23% ~08s
|++++++++++++ | 24% ~08s
|+++++++++++++ | 25% ~08s
|+++++++++++++ | 26% ~08s
|++++++++++++++ | 27% ~08s
|++++++++++++++ | 28% ~08s
|+++++++++++++++ | 29% ~07s
|+++++++++++++++ | 30% ~07s
|++++++++++++++++ | 31% ~07s
|++++++++++++++++ | 32% ~07s
|+++++++++++++++++ | 33% ~07s
|++++++++++++++++++ | 34% ~07s
|++++++++++++++++++ | 35% ~07s
|+++++++++++++++++++ | 36% ~07s
|+++++++++++++++++++ | 37% ~07s
|++++++++++++++++++++ | 38% ~06s
|++++++++++++++++++++ | 39% ~06s
|+++++++++++++++++++++ | 40% ~06s
|+++++++++++++++++++++ | 41% ~06s
|++++++++++++++++++++++ | 42% ~06s
|++++++++++++++++++++++ | 43% ~06s
|+++++++++++++++++++++++ | 44% ~06s
|+++++++++++++++++++++++ | 45% ~06s
|++++++++++++++++++++++++ | 46% ~06s
|++++++++++++++++++++++++ | 47% ~06s
|+++++++++++++++++++++++++ | 48% ~05s
|+++++++++++++++++++++++++ | 49% ~05s
|++++++++++++++++++++++++++ | 51% ~05s
|++++++++++++++++++++++++++ | 52% ~05s
|+++++++++++++++++++++++++++ | 53% ~05s
|+++++++++++++++++++++++++++ | 54% ~05s
|++++++++++++++++++++++++++++ | 55% ~05s
|++++++++++++++++++++++++++++ | 56% ~05s
|+++++++++++++++++++++++++++++ | 57% ~05s
|+++++++++++++++++++++++++++++ | 58% ~05s
|++++++++++++++++++++++++++++++ | 59% ~04s
|++++++++++++++++++++++++++++++ | 60% ~04s
|+++++++++++++++++++++++++++++++ | 61% ~04s
|+++++++++++++++++++++++++++++++ | 62% ~04s
|++++++++++++++++++++++++++++++++ | 63% ~04s
|++++++++++++++++++++++++++++++++ | 64% ~04s
|+++++++++++++++++++++++++++++++++ | 65% ~04s
|+++++++++++++++++++++++++++++++++ | 66% ~04s
|++++++++++++++++++++++++++++++++++ | 67% ~04s
|+++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 69% ~03s
|++++++++++++++++++++++++++++++++++++ | 70% ~03s
|++++++++++++++++++++++++++++++++++++ | 71% ~03s
|+++++++++++++++++++++++++++++++++++++ | 72% ~03s
|+++++++++++++++++++++++++++++++++++++ | 73% ~03s
|++++++++++++++++++++++++++++++++++++++ | 74% ~03s
|++++++++++++++++++++++++++++++++++++++ | 75% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 12s
| | 0 % ~calculating
|+ | 1 % ~11s
|++ | 2 % ~09s
|++ | 3 % ~08s
|+++ | 4 % ~08s
|+++ | 5 % ~07s
|++++ | 6 % ~07s
|++++ | 7 % ~07s
|+++++ | 8 % ~07s
|+++++ | 9 % ~07s
|++++++ | 10% ~07s
|++++++ | 11% ~07s
|+++++++ | 12% ~07s
|+++++++ | 13% ~07s
|++++++++ | 14% ~07s
|++++++++ | 15% ~07s
|+++++++++ | 16% ~06s
|+++++++++ | 17% ~06s
|++++++++++ | 18% ~06s
|++++++++++ | 19% ~06s
|+++++++++++ | 20% ~06s
|+++++++++++ | 21% ~06s
|++++++++++++ | 22% ~06s
|++++++++++++ | 23% ~06s
|+++++++++++++ | 24% ~06s
|+++++++++++++ | 25% ~06s
|++++++++++++++ | 26% ~06s
|++++++++++++++ | 27% ~06s
|+++++++++++++++ | 28% ~06s
|+++++++++++++++ | 29% ~06s
|++++++++++++++++ | 30% ~05s
|++++++++++++++++ | 31% ~05s
|+++++++++++++++++ | 32% ~05s
|+++++++++++++++++ | 33% ~05s
|++++++++++++++++++ | 34% ~05s
|++++++++++++++++++ | 35% ~05s
|+++++++++++++++++++ | 36% ~05s
|+++++++++++++++++++ | 37% ~05s
|++++++++++++++++++++ | 38% ~05s
|++++++++++++++++++++ | 39% ~05s
|+++++++++++++++++++++ | 40% ~05s
|+++++++++++++++++++++ | 41% ~05s
|++++++++++++++++++++++ | 42% ~04s
|++++++++++++++++++++++ | 43% ~04s
|+++++++++++++++++++++++ | 44% ~04s
|+++++++++++++++++++++++ | 45% ~04s
|++++++++++++++++++++++++ | 46% ~04s
|++++++++++++++++++++++++ | 47% ~04s
|+++++++++++++++++++++++++ | 48% ~04s
|+++++++++++++++++++++++++ | 49% ~04s
|++++++++++++++++++++++++++ | 51% ~04s
|++++++++++++++++++++++++++ | 52% ~04s
|+++++++++++++++++++++++++++ | 53% ~04s
|+++++++++++++++++++++++++++ | 54% ~04s
|++++++++++++++++++++++++++++ | 55% ~04s
|++++++++++++++++++++++++++++ | 56% ~03s
|+++++++++++++++++++++++++++++ | 57% ~03s
|+++++++++++++++++++++++++++++ | 58% ~03s
|++++++++++++++++++++++++++++++ | 59% ~03s
|++++++++++++++++++++++++++++++ | 60% ~03s
|+++++++++++++++++++++++++++++++ | 61% ~03s
|+++++++++++++++++++++++++++++++ | 62% ~03s
|++++++++++++++++++++++++++++++++ | 63% ~03s
|++++++++++++++++++++++++++++++++ | 64% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|+++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 69% ~02s
|+++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~02s
|+++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 75% ~02s
|++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 08s
| | 0 % ~calculating
|+ | 1 % ~08s
|++ | 2 % ~07s
|++ | 3 % ~07s
|+++ | 4 % ~07s
|+++ | 5 % ~07s
|++++ | 7 % ~07s
|++++ | 8 % ~07s
|+++++ | 9 % ~07s
|+++++ | 10% ~07s
|++++++ | 11% ~07s
|++++++ | 12% ~07s
|+++++++ | 13% ~07s
|++++++++ | 14% ~07s
|++++++++ | 15% ~07s
|+++++++++ | 16% ~07s
|+++++++++ | 17% ~07s
|++++++++++ | 18% ~06s
|++++++++++ | 20% ~06s
|+++++++++++ | 21% ~06s
|+++++++++++ | 22% ~06s
|++++++++++++ | 23% ~06s
|++++++++++++ | 24% ~06s
|+++++++++++++ | 25% ~06s
|++++++++++++++ | 26% ~06s
|++++++++++++++ | 27% ~06s
|+++++++++++++++ | 28% ~06s
|+++++++++++++++ | 29% ~06s
|++++++++++++++++ | 30% ~05s
|++++++++++++++++ | 32% ~05s
|+++++++++++++++++ | 33% ~05s
|+++++++++++++++++ | 34% ~05s
|++++++++++++++++++ | 35% ~05s
|++++++++++++++++++ | 36% ~05s
|+++++++++++++++++++ | 37% ~05s
|++++++++++++++++++++ | 38% ~05s
|++++++++++++++++++++ | 39% ~05s
|+++++++++++++++++++++ | 40% ~05s
|+++++++++++++++++++++ | 41% ~05s
|++++++++++++++++++++++ | 42% ~04s
|++++++++++++++++++++++ | 43% ~04s
|+++++++++++++++++++++++ | 45% ~04s
|+++++++++++++++++++++++ | 46% ~04s
|++++++++++++++++++++++++ | 47% ~04s
|++++++++++++++++++++++++ | 48% ~04s
|+++++++++++++++++++++++++ | 49% ~04s
|+++++++++++++++++++++++++ | 50% ~04s
|++++++++++++++++++++++++++ | 51% ~04s
|+++++++++++++++++++++++++++ | 52% ~04s
|+++++++++++++++++++++++++++ | 53% ~04s
|++++++++++++++++++++++++++++ | 54% ~04s
|++++++++++++++++++++++++++++ | 55% ~04s
|+++++++++++++++++++++++++++++ | 57% ~03s
|+++++++++++++++++++++++++++++ | 58% ~03s
|++++++++++++++++++++++++++++++ | 59% ~03s
|++++++++++++++++++++++++++++++ | 60% ~03s
|+++++++++++++++++++++++++++++++ | 61% ~03s
|+++++++++++++++++++++++++++++++ | 62% ~03s
|++++++++++++++++++++++++++++++++ | 63% ~03s
|+++++++++++++++++++++++++++++++++ | 64% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|++++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|+++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~02s
|+++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 75% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 08s
| | 0 % ~calculating
|+ | 1 % ~13s
|++ | 2 % ~13s
|++ | 3 % ~12s
|+++ | 4 % ~12s
|+++ | 5 % ~12s
|++++ | 6 % ~13s
|++++ | 7 % ~13s
|+++++ | 8 % ~13s
|+++++ | 9 % ~12s
|++++++ | 10% ~12s
|++++++ | 11% ~12s
|+++++++ | 12% ~12s
|+++++++ | 13% ~12s
|++++++++ | 14% ~12s
|++++++++ | 15% ~12s
|+++++++++ | 16% ~11s
|+++++++++ | 17% ~11s
|++++++++++ | 18% ~11s
|++++++++++ | 19% ~11s
|+++++++++++ | 20% ~11s
|+++++++++++ | 21% ~11s
|++++++++++++ | 22% ~10s
|++++++++++++ | 23% ~10s
|+++++++++++++ | 24% ~10s
|+++++++++++++ | 25% ~10s
|++++++++++++++ | 26% ~10s
|++++++++++++++ | 27% ~10s
|+++++++++++++++ | 28% ~10s
|+++++++++++++++ | 29% ~10s
|++++++++++++++++ | 30% ~09s
|++++++++++++++++ | 31% ~09s
|+++++++++++++++++ | 32% ~09s
|+++++++++++++++++ | 33% ~09s
|++++++++++++++++++ | 34% ~09s
|++++++++++++++++++ | 35% ~09s
|+++++++++++++++++++ | 36% ~09s
|+++++++++++++++++++ | 37% ~09s
|++++++++++++++++++++ | 38% ~09s
|++++++++++++++++++++ | 39% ~09s
|+++++++++++++++++++++ | 40% ~09s
|+++++++++++++++++++++ | 41% ~08s
|++++++++++++++++++++++ | 42% ~08s
|++++++++++++++++++++++ | 43% ~08s
|+++++++++++++++++++++++ | 44% ~08s
|+++++++++++++++++++++++ | 45% ~08s
|++++++++++++++++++++++++ | 46% ~08s
|++++++++++++++++++++++++ | 47% ~08s
|+++++++++++++++++++++++++ | 48% ~08s
|+++++++++++++++++++++++++ | 49% ~07s
|++++++++++++++++++++++++++ | 51% ~07s
|++++++++++++++++++++++++++ | 52% ~07s
|+++++++++++++++++++++++++++ | 53% ~07s
|+++++++++++++++++++++++++++ | 54% ~07s
|++++++++++++++++++++++++++++ | 55% ~07s
|++++++++++++++++++++++++++++ | 56% ~07s
|+++++++++++++++++++++++++++++ | 57% ~07s
|+++++++++++++++++++++++++++++ | 58% ~06s
|++++++++++++++++++++++++++++++ | 59% ~06s
|++++++++++++++++++++++++++++++ | 60% ~06s
|+++++++++++++++++++++++++++++++ | 61% ~06s
|+++++++++++++++++++++++++++++++ | 62% ~06s
|++++++++++++++++++++++++++++++++ | 63% ~06s
|++++++++++++++++++++++++++++++++ | 64% ~05s
|+++++++++++++++++++++++++++++++++ | 65% ~05s
|+++++++++++++++++++++++++++++++++ | 66% ~05s
|++++++++++++++++++++++++++++++++++ | 67% ~05s
|++++++++++++++++++++++++++++++++++ | 68% ~05s
|+++++++++++++++++++++++++++++++++++ | 69% ~05s
|+++++++++++++++++++++++++++++++++++ | 70% ~05s
|++++++++++++++++++++++++++++++++++++ | 71% ~04s
|++++++++++++++++++++++++++++++++++++ | 72% ~04s
|+++++++++++++++++++++++++++++++++++++ | 73% ~04s
|+++++++++++++++++++++++++++++++++++++ | 74% ~04s
|++++++++++++++++++++++++++++++++++++++ | 75% ~04s
|++++++++++++++++++++++++++++++++++++++ | 76% ~04s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~04s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~03s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~03s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~03s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~03s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 16s
| | 0 % ~calculating
|+ | 1 % ~09s
|++ | 2 % ~09s
|++ | 3 % ~09s
|+++ | 4 % ~09s
|+++ | 5 % ~09s
|++++ | 7 % ~08s
|++++ | 8 % ~08s
|+++++ | 9 % ~08s
|+++++ | 10% ~08s
|++++++ | 11% ~08s
|++++++ | 12% ~08s
|+++++++ | 13% ~08s
|++++++++ | 14% ~07s
|++++++++ | 15% ~07s
|+++++++++ | 16% ~07s
|+++++++++ | 17% ~07s
|++++++++++ | 18% ~07s
|++++++++++ | 20% ~07s
|+++++++++++ | 21% ~07s
|+++++++++++ | 22% ~07s
|++++++++++++ | 23% ~07s
|++++++++++++ | 24% ~07s
|+++++++++++++ | 25% ~07s
|++++++++++++++ | 26% ~07s
|++++++++++++++ | 27% ~06s
|+++++++++++++++ | 28% ~06s
|+++++++++++++++ | 29% ~06s
|++++++++++++++++ | 30% ~06s
|++++++++++++++++ | 32% ~06s
|+++++++++++++++++ | 33% ~06s
|+++++++++++++++++ | 34% ~06s
|++++++++++++++++++ | 35% ~06s
|++++++++++++++++++ | 36% ~06s
|+++++++++++++++++++ | 37% ~06s
|++++++++++++++++++++ | 38% ~06s
|++++++++++++++++++++ | 39% ~06s
|+++++++++++++++++++++ | 40% ~05s
|+++++++++++++++++++++ | 41% ~05s
|++++++++++++++++++++++ | 42% ~05s
|++++++++++++++++++++++ | 43% ~05s
|+++++++++++++++++++++++ | 45% ~05s
|+++++++++++++++++++++++ | 46% ~05s
|++++++++++++++++++++++++ | 47% ~05s
|++++++++++++++++++++++++ | 48% ~05s
|+++++++++++++++++++++++++ | 49% ~04s
|+++++++++++++++++++++++++ | 50% ~04s
|++++++++++++++++++++++++++ | 51% ~04s
|+++++++++++++++++++++++++++ | 52% ~04s
|+++++++++++++++++++++++++++ | 53% ~04s
|++++++++++++++++++++++++++++ | 54% ~04s
|++++++++++++++++++++++++++++ | 55% ~04s
|+++++++++++++++++++++++++++++ | 57% ~04s
|+++++++++++++++++++++++++++++ | 58% ~04s
|++++++++++++++++++++++++++++++ | 59% ~04s
|++++++++++++++++++++++++++++++ | 60% ~04s
|+++++++++++++++++++++++++++++++ | 61% ~04s
|+++++++++++++++++++++++++++++++ | 62% ~03s
|++++++++++++++++++++++++++++++++ | 63% ~03s
|+++++++++++++++++++++++++++++++++ | 64% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|++++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|+++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 70% ~03s
|++++++++++++++++++++++++++++++++++++ | 71% ~03s
|++++++++++++++++++++++++++++++++++++ | 72% ~03s
|+++++++++++++++++++++++++++++++++++++ | 73% ~03s
|+++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 75% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 09s
| | 0 % ~calculating
|+ | 1 % ~20s
|++ | 2 % ~19s
|++ | 3 % ~18s
|+++ | 4 % ~18s
|+++ | 5 % ~18s
|++++ | 6 % ~17s
|++++ | 7 % ~17s
|+++++ | 8 % ~17s
|+++++ | 9 % ~17s
|++++++ | 10% ~17s
|++++++ | 11% ~17s
|+++++++ | 12% ~17s
|+++++++ | 13% ~16s
|++++++++ | 14% ~16s
|++++++++ | 15% ~16s
|+++++++++ | 16% ~16s
|+++++++++ | 17% ~16s
|++++++++++ | 18% ~15s
|++++++++++ | 19% ~15s
|+++++++++++ | 20% ~15s
|+++++++++++ | 21% ~15s
|++++++++++++ | 22% ~15s
|++++++++++++ | 23% ~14s
|+++++++++++++ | 24% ~14s
|+++++++++++++ | 26% ~14s
|++++++++++++++ | 27% ~14s
|++++++++++++++ | 28% ~14s
|+++++++++++++++ | 29% ~14s
|+++++++++++++++ | 30% ~13s
|++++++++++++++++ | 31% ~13s
|++++++++++++++++ | 32% ~13s
|+++++++++++++++++ | 33% ~13s
|+++++++++++++++++ | 34% ~13s
|++++++++++++++++++ | 35% ~12s
|++++++++++++++++++ | 36% ~12s
|+++++++++++++++++++ | 37% ~12s
|+++++++++++++++++++ | 38% ~12s
|++++++++++++++++++++ | 39% ~12s
|++++++++++++++++++++ | 40% ~11s
|+++++++++++++++++++++ | 41% ~11s
|+++++++++++++++++++++ | 42% ~11s
|++++++++++++++++++++++ | 43% ~11s
|++++++++++++++++++++++ | 44% ~11s
|+++++++++++++++++++++++ | 45% ~11s
|+++++++++++++++++++++++ | 46% ~10s
|++++++++++++++++++++++++ | 47% ~10s
|++++++++++++++++++++++++ | 48% ~10s
|+++++++++++++++++++++++++ | 49% ~10s
|+++++++++++++++++++++++++ | 50% ~10s
|++++++++++++++++++++++++++ | 51% ~09s
|+++++++++++++++++++++++++++ | 52% ~09s
|+++++++++++++++++++++++++++ | 53% ~09s
|++++++++++++++++++++++++++++ | 54% ~09s
|++++++++++++++++++++++++++++ | 55% ~09s
|+++++++++++++++++++++++++++++ | 56% ~09s
|+++++++++++++++++++++++++++++ | 57% ~08s
|++++++++++++++++++++++++++++++ | 58% ~08s
|++++++++++++++++++++++++++++++ | 59% ~08s
|+++++++++++++++++++++++++++++++ | 60% ~08s
|+++++++++++++++++++++++++++++++ | 61% ~08s
|++++++++++++++++++++++++++++++++ | 62% ~07s
|++++++++++++++++++++++++++++++++ | 63% ~07s
|+++++++++++++++++++++++++++++++++ | 64% ~07s
|+++++++++++++++++++++++++++++++++ | 65% ~07s
|++++++++++++++++++++++++++++++++++ | 66% ~07s
|++++++++++++++++++++++++++++++++++ | 67% ~06s
|+++++++++++++++++++++++++++++++++++ | 68% ~06s
|+++++++++++++++++++++++++++++++++++ | 69% ~06s
|++++++++++++++++++++++++++++++++++++ | 70% ~06s
|++++++++++++++++++++++++++++++++++++ | 71% ~06s
|+++++++++++++++++++++++++++++++++++++ | 72% ~05s
|+++++++++++++++++++++++++++++++++++++ | 73% ~05s
|++++++++++++++++++++++++++++++++++++++ | 74% ~05s
|++++++++++++++++++++++++++++++++++++++ | 76% ~05s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~05s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~04s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~03s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~03s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 20s
| | 0 % ~calculating
|+ | 1 % ~12s
|++ | 2 % ~12s
|++ | 3 % ~11s
|+++ | 4 % ~11s
|+++ | 5 % ~11s
|++++ | 6 % ~11s
|++++ | 7 % ~11s
|+++++ | 8 % ~10s
|+++++ | 9 % ~10s
|++++++ | 10% ~10s
|++++++ | 11% ~10s
|+++++++ | 12% ~10s
|+++++++ | 14% ~10s
|++++++++ | 15% ~10s
|++++++++ | 16% ~10s
|+++++++++ | 17% ~10s
|+++++++++ | 18% ~10s
|++++++++++ | 19% ~10s
|++++++++++ | 20% ~10s
|+++++++++++ | 21% ~09s
|+++++++++++ | 22% ~09s
|++++++++++++ | 23% ~09s
|++++++++++++ | 24% ~09s
|+++++++++++++ | 25% ~09s
|++++++++++++++ | 26% ~09s
|++++++++++++++ | 27% ~09s
|+++++++++++++++ | 28% ~09s
|+++++++++++++++ | 29% ~08s
|++++++++++++++++ | 30% ~08s
|++++++++++++++++ | 31% ~08s
|+++++++++++++++++ | 32% ~08s
|+++++++++++++++++ | 33% ~08s
|++++++++++++++++++ | 34% ~08s
|++++++++++++++++++ | 35% ~08s
|+++++++++++++++++++ | 36% ~08s
|+++++++++++++++++++ | 38% ~07s
|++++++++++++++++++++ | 39% ~07s
|++++++++++++++++++++ | 40% ~07s
|+++++++++++++++++++++ | 41% ~07s
|+++++++++++++++++++++ | 42% ~07s
|++++++++++++++++++++++ | 43% ~07s
|++++++++++++++++++++++ | 44% ~07s
|+++++++++++++++++++++++ | 45% ~07s
|+++++++++++++++++++++++ | 46% ~07s
|++++++++++++++++++++++++ | 47% ~06s
|++++++++++++++++++++++++ | 48% ~06s
|+++++++++++++++++++++++++ | 49% ~06s
|+++++++++++++++++++++++++ | 50% ~06s
|++++++++++++++++++++++++++ | 51% ~06s
|+++++++++++++++++++++++++++ | 52% ~06s
|+++++++++++++++++++++++++++ | 53% ~06s
|++++++++++++++++++++++++++++ | 54% ~06s
|++++++++++++++++++++++++++++ | 55% ~05s
|+++++++++++++++++++++++++++++ | 56% ~05s
|+++++++++++++++++++++++++++++ | 57% ~05s
|++++++++++++++++++++++++++++++ | 58% ~05s
|++++++++++++++++++++++++++++++ | 59% ~05s
|+++++++++++++++++++++++++++++++ | 60% ~05s
|+++++++++++++++++++++++++++++++ | 61% ~05s
|++++++++++++++++++++++++++++++++ | 62% ~05s
|++++++++++++++++++++++++++++++++ | 64% ~04s
|+++++++++++++++++++++++++++++++++ | 65% ~04s
|+++++++++++++++++++++++++++++++++ | 66% ~04s
|++++++++++++++++++++++++++++++++++ | 67% ~04s
|++++++++++++++++++++++++++++++++++ | 68% ~04s
|+++++++++++++++++++++++++++++++++++ | 69% ~04s
|+++++++++++++++++++++++++++++++++++ | 70% ~04s
|++++++++++++++++++++++++++++++++++++ | 71% ~04s
|++++++++++++++++++++++++++++++++++++ | 72% ~04s
|+++++++++++++++++++++++++++++++++++++ | 73% ~03s
|+++++++++++++++++++++++++++++++++++++ | 74% ~03s
|++++++++++++++++++++++++++++++++++++++ | 75% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~03s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~03s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~03s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 13s
Display the top markers you computed above.
#tiss.markers %>% group_by(cluster) %>% top_n(5, avg_diff)
At a coarse level, we can use canonical markers to match the unbiased clustering to known cell types:
0: Coronary_vascular_EDC 1: Fb 2: Fb 3: Blood_Cells 4: Endocardial_EDC 5: CMs 6: SMC
# stash current cluster IDs
tiss <- StashIdent(object = tiss, save.name = "cluster.ids")
# enumerate current cluster IDs and the labels for them
cluster.ids <- c(0, 1, 2, 3, 4, 5,6)
cell_ontology_class <- c("endothelial cell", "fibroblast","fibroblast", "erythrocyte", "endocardial cell", "cardiac muscle cell", "Smooth Muscle Cell")
cell_ontology_id <- c("CL:0000115", "CL:0000057", "CL:0000057", "CL:0002350", "CL:0000746", "CL:0000232", "CL:0000192")
tiss@meta.data[,'cell_ontology_class'] <- plyr::mapvalues(x = tiss@ident, from = cluster.ids, to = cell_ontology_class)
tiss@meta.data[,'cell_ontology_id'] <- plyr::mapvalues(x = tiss@ident, from = cluster.ids, to = cell_ontology_id)
tiss@meta.data[tiss@cell.names,'cell_ontology_class'] <- as.character(tiss@meta.data$cell_ontology_class)
tiss@meta.data[tiss@cell.names,'cell_ontology_id'] <- as.character(tiss@meta.data$cell_ontology_id)
TSNEPlot(object = tiss, do.label = TRUE, pt.size = 0.5, group.by='cell_ontology_class')
Color by metadata, like plate barcode, to check for batch effects.
TSNEPlot(object = tiss, do.return = TRUE, group.by = "channel")
TSNEPlot(object = tiss, do.return = TRUE, group.by = "mouse.sex")
Print a table showing the count of cells in each identity category from each plate.
table(as.character(tiss@ident), as.character(tiss@meta.data$channel))
10X_P7_4
0 177
1 135
2 87
3 81
4 63
5 60
6 21
We can repeat the above analysis on a subset of cells, defined using cluster IDs or some other metadata. This is a good way to drill down and find substructure.
# Subset data based on cluster id
subtiss <- SubsetData(object = tiss, ident.use = c(2), do.center = F, do.scale = F, cells.use = )
# To subset data based on cell_ontology_class or other metadata, you can explicitly pass cell names
#cells.to.use = tiss@cell.names[which(tiss@meta.data$mouse.sex == 'F')]
#subtiss <- SubsetData(object = tiss, cells.use = cells.to.use, do.center = F, do.scale = F)
subtiss <- NormalizeData(object = subtiss)
Performing log-normalization
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
subtiss <- ScaleData(object = subtiss, vars.to.regress = c("nUMI", "percent.ribo","Rn45s"))
[1] "Regressing out nUMI" "Regressing out percent.ribo"
[3] "Regressing out Rn45s"
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 9%
|
|======== | 9%
|
|======== | 10%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|============ | 15%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 24%
|
|==================== | 25%
|
|===================== | 26%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================== | 29%
|
|======================== | 30%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|=========================== | 33%
|
|=========================== | 34%
|
|============================ | 35%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|=============================== | 38%
|
|=============================== | 39%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================== | 42%
|
|================================== | 43%
|
|=================================== | 43%
|
|=================================== | 44%
|
|==================================== | 44%
|
|==================================== | 45%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 47%
|
|====================================== | 48%
|
|======================================= | 48%
|
|======================================= | 49%
|
|======================================== | 50%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 52%
|
|========================================== | 53%
|
|=========================================== | 53%
|
|=========================================== | 54%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================== | 57%
|
|============================================== | 58%
|
|=============================================== | 59%
|
|================================================ | 59%
|
|================================================ | 60%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================== | 62%
|
|================================================== | 63%
|
|=================================================== | 63%
|
|=================================================== | 64%
|
|==================================================== | 65%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|====================================================== | 67%
|
|====================================================== | 68%
|
|======================================================= | 68%
|
|======================================================= | 69%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|========================================================= | 71%
|
|========================================================= | 72%
|
|========================================================== | 72%
|
|========================================================== | 73%
|
|=========================================================== | 74%
|
|============================================================ | 75%
|
|============================================================= | 76%
|
|============================================================== | 77%
|
|============================================================== | 78%
|
|=============================================================== | 78%
|
|=============================================================== | 79%
|
|================================================================ | 79%
|
|================================================================ | 80%
|
|================================================================= | 81%
|
|================================================================= | 82%
|
|================================================================== | 82%
|
|================================================================== | 83%
|
|=================================================================== | 83%
|
|=================================================================== | 84%
|
|==================================================================== | 85%
|
|===================================================================== | 86%
|
|===================================================================== | 87%
|
|====================================================================== | 87%
|
|====================================================================== | 88%
|
|======================================================================= | 88%
|
|======================================================================= | 89%
|
|======================================================================== | 90%
|
|======================================================================== | 91%
|
|========================================================================= | 91%
|
|========================================================================== | 92%
|
|========================================================================== | 93%
|
|=========================================================================== | 93%
|
|=========================================================================== | 94%
|
|============================================================================ | 94%
|
|============================================================================ | 95%
|
|============================================================================= | 96%
|
|============================================================================= | 97%
|
|============================================================================== | 97%
|
|============================================================================== | 98%
|
|=============================================================================== | 98%
|
|=============================================================================== | 99%
|
|================================================================================| 100%
[1] "Scaling data matrix"
|
| | 0%
|
|================================================================================| 100%
Run Principal Component Analysis.
subtiss <- FindVariableGenes(object = subtiss, do.plot = TRUE, x.high.cutoff = Inf, y.cutoff = 0.8)
Calculating gene means
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variance to mean ratios
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
subtiss <- RunPCA(object = subtiss, pcs.compute = 20, weight.by.var = F)
[1] "PC1"
[1] "Igfbp6" "S100a6" "Gpr133" "Lrrn4cl" "Fndc1" "Cd248" "Adamts5" "Crip1"
[9] "Efhd1" "Mustn1" "Stmn4" "Pla1a" "Cadm3" "Loxl2" "Flnb" "Pcsk6"
[17] "Sema3c" "Gfpt2" "Anxa3" "Pcolce2" "Limch1" "Basp1" "Ly6c1" "Cxcr7"
[25] "Ahdc1" "Carhsp1" "Nov" "Prelp" "Ret" "Nhsl1"
[1] ""
[1] "Mfap4" "Apoe" "Crispld2" "Igf1" "Fbln1"
[6] "Ndrg2" "Heyl" "Eln" "Cxcl12" "Podn"
[11] "Osr1" "Mt1" "Ccl19" "Nr4a1" "Stc2"
[16] "Foxs1" "Tgfb3" "Aspa" "Tgfbi" "Cpe"
[21] "Msx1" "Slco2b1" "S1pr3" "Gt(ROSA)26Sor" "2610524H06Rik"
[26] "Sesn3" "Trim24" "Pdgfrl" "Mfap2" "Xpnpep1"
[1] ""
[1] ""
[1] "PC2"
[1] "BC026590" "B4galt6" "Tsku" "Mllt11" "Cdr2l"
[6] "Zfp595" "Cdc42ep1" "Zc3h10" "4930455F23Rik" "6030419C18Rik"
[11] "Ltv1" "Polg2" "Fam118a" "Cmtm4" "Alg6"
[16] "Pak3" "Elac1" "Adcy4" "Spin4" "Phospho1"
[21] "Bcl2l2" "Snx32" "Lrp5" "Taf13" "2210404O07Rik"
[26] "BC006779" "2210411K11Rik" "Ttpal" "Id1" "5031425E22Rik"
[1] ""
[1] "Ctdp1" "Cxcl12" "Grhpr" "Smoc2" "Prss23"
[6] "Abcb10" "Ubb" "Homez" "Vezt" "Plekhf1"
[11] "Dynlt1f" "Ezh2" "Tef" "Gcc1" "2610035D17Rik"
[16] "Cdc42bpg" "Gatc" "Emp3" "Atg4a" "C1rl"
[21] "Gpd1l" "Zbtb2" "Pdzd4" "Gpx3" "Ilvbl"
[26] "Igsf3" "Olfml3" "2310015A10Rik" "Khdrbs3" "Mrps23"
[1] ""
[1] ""
[1] "PC3"
[1] "Zfp182" "Topbp1" "LOC100642166" "S100pbp" "Snx14"
[6] "Fam149b" "Aqp2" "Acads" "Gm12824" "Sept1"
[11] "Pmpca" "Prrg3" "Dnmt3l" "Slc37a4" "B3galnt1"
[16] "Csnk1g1" "Pde8a" "Csrp2bp" "Mlkl" "Tssc1"
[21] "Zfpm2" "B230312A22Rik" "Snai2" "Mis12" "Zfp688"
[26] "Scai" "Acy1" "Ankrd13c" "Slc22a17" "Ppp3cc"
[1] ""
[1] "Pmepa1" "Atp6v0e2" "Slc26a2" "Msrb2" "Cdc25b" "Pam" "Gxylt2"
[8] "Pdgfrb" "Gata6" "Eif4ebp1" "Them4" "Arid1a" "Braf" "Zswim6"
[15] "AI607873" "Myo5a" "Nop16" "Nedd9" "Mr1" "Tbc1d2b" "Tmem205"
[22] "Glrx" "Gm4944" "Fibin" "Magi2" "Col8a1" "Grhpr" "Pycr2"
[29] "Atxn7l1" "Fah"
[1] ""
[1] ""
[1] "PC4"
[1] "Pla2r1" "Sesn1" "Camsap2" "Kdm3b" "Mypop"
[6] "Ctdp1" "Phkg2" "Fah" "Pip4k2b" "Pycr2"
[11] "Cbx8" "Kdm3a" "Map3k1" "B4galnt1" "Pyroxd1"
[16] "Zfp781" "Cdc25b" "Cry2" "Mpp6" "Arl6"
[21] "Trap1" "1600020E01Rik" "Sdccag3" "Nfya" "Tmeff2"
[26] "Pvt1" "Bach1" "Cox8b" "Efna1" "AI607873"
[1] ""
[1] "Fos" "Htra3" "Igfbp4" "Podn" "Tsc22d1" "Cdc42ep2" "Nudt2"
[8] "G0s2" "Cdc42se1" "Sfrp1" "Ankrd13a" "Arrdc3" "Mafb" "Scara5"
[15] "Xrcc1" "Angptl1" "Leprel2" "Lpl" "Pi16" "Col1a2" "Mapk7"
[22] "Steap3" "Sap30l" "Atf4" "Tmem52" "Aspa" "Exd2" "Tppp3"
[29] "Ncoa6" "Nup160"
[1] ""
[1] ""
[1] "PC5"
[1] "Egr1" "Junb" "Actg1" "Mt2" "Nr4a1" "Mt1" "Cables2"
[8] "Dusp1" "Tmed8" "Dpagt1" "Supt7l" "Btg2" "Cebpb" "Fos"
[15] "Scara5" "Hira" "Qars" "Actc1" "Ifih1" "Zfp36" "Bin1"
[22] "Glrx" "Ddx55" "Klf4" "Ttll1" "Arl4d" "Apoe" "Ppp5c"
[29] "Igsf8" "Marcksl1"
[1] ""
[1] "Edc4" "Gm14005" "D430019H16Rik" "Rxrb" "Angptl6"
[6] "Snx9" "Aspn" "Mecom" "Zfp119a" "Fam109a"
[11] "Pappa" "Gm11627" "Tsc2" "Dda1" "Cep290"
[16] "Arsj" "March8" "Omd" "5730419I09Rik" "Kpna6"
[21] "Lbh" "Phtf1" "Zfp229" "Gpatch1" "Naa30"
[26] "Slc40a1" "Msc" "Atxn1l" "Mettl15" "Kbtbd3"
[1] ""
[1] ""
subtiss <- ProjectPCA(object = subtiss, do.print = FALSE)
# If this fails for your subset, it may be that cells.use is more cells than you have left! Try reducing it.
PCHeatmap(object = subtiss, pc.use = 1:3, cells.use = 70, do.balanced = TRUE, label.columns = FALSE, num.genes = 12)
Later on (in FindClusters and TSNE) you will pick a number of principal components to use. This has the effect of keeping the major directions of variation in the data and, ideally, supressing noise. There is no correct answer to the number to use, but a decent rule of thumb is to go until the plot plateaus.
PCElbowPlot(object = subtiss)
Choose the number of principal components to use.
# Set number of principal components.
sub.n.pcs = 5
The clustering is performed based on a nearest neighbors graph. Cells that have similar expression will be joined together. The Louvain algorithm looks for groups of cells with high modularity–more connections within the group than between groups. The resolution parameter determines the scale…higher resolution will give more clusters, lower resolution will give fewer.
# Set resolution
sub.res.used <- 1
subtiss <- FindClusters(object = subtiss, reduction.type = "pca", dims.use = 1:sub.n.pcs,
resolution = sub.res.used, ,print.output = 0, save.SNN = TRUE)
To visualize
# If cells are too spread out, you can raise the perplexity. If you have few cells, try a lower perplexity (but never less than 10).
subtiss <- RunTSNE(object = subtiss, dims.use = 1:sub.n.pcs, seed.use = 10, perplexity=20)
# note that you can set do.label=T to help label individual clusters
TSNEPlot(object = subtiss, do.label = T)
subtiss.markers <- FindAllMarkers(object = subtiss, only.pos = TRUE, min.pct = 0.25, thresh.use = 0.25)
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~01s
|++ | 3 % ~01s
|+++ | 4 % ~01s
|+++ | 5 % ~01s
|++++ | 7 % ~01s
|++++ | 8 % ~01s
|+++++ | 9 % ~01s
|+++++ | 10% ~01s
|++++++ | 11% ~01s
|+++++++ | 12% ~01s
|+++++++ | 13% ~01s
|++++++++ | 14% ~01s
|++++++++ | 15% ~01s
|+++++++++ | 16% ~01s
|+++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|+++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 24% ~01s
|+++++++++++++ | 25% ~01s
|++++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|+++++++++++++++ | 29% ~01s
|+++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|++++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|+++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~01s
|++++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|+++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|++++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|+++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|+++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|+++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|+++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|+++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 01s
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~01s
|++ | 3 % ~01s
|+++ | 4 % ~01s
|+++ | 5 % ~01s
|++++ | 7 % ~01s
|++++ | 8 % ~01s
|+++++ | 9 % ~01s
|+++++ | 10% ~01s
|++++++ | 11% ~01s
|+++++++ | 12% ~01s
|+++++++ | 13% ~01s
|++++++++ | 14% ~01s
|++++++++ | 15% ~01s
|+++++++++ | 16% ~01s
|+++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|+++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 24% ~01s
|+++++++++++++ | 25% ~01s
|++++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|+++++++++++++++ | 29% ~01s
|+++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|++++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|+++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~01s
|++++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|+++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|++++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|+++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|+++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|+++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|+++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|+++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 01s
subtiss.markers %>% group_by(cluster) %>% top_n(6, avg_diff)
Check expression of genes of interset.
genes_to_check = c('Myh11','Dcn')
FeaturePlot(subtiss, genes_to_check, pt.size = 1)
Dotplots let you see the intensity of exppression and the fraction of cells expressing for each of your genes of interest.
# To change the y-axis to show raw counts, add use.raw = T.
DotPlot(subtiss, genes_to_check, plot.legend = T)
How big are the clusters?
table(subtiss@ident)
0 1
49 38
Color by metadata, like plate barcode, to check for batch effects.
TSNEPlot(object = subtiss, do.return = TRUE, group.by = "channel")
Print a table showing the count of cells in each identity category from each plate.
table(as.character(subtiss@ident), as.character(subtiss@meta.data$channel))
10X_P7_4
0 49
1 38
For the subsets, we produce subcell_ontology_classs. These will be written back as metadata in the original object, so we can see all subcell_ontology_classs together.
If some of the clusters you find in the subset deserve additional cell_ontology_class, you can add that right here. Use NA for clusters for which no subcell_ontology_class is needed.
subcluster.ids <- c(0, 1)
subcell_ontology_class <- c("fibroblast", "fibroblast")
subcell_ontology_id = c("CL:0000057", "CL:0000057")
subtiss@meta.data[,'cell_ontology_class'] <- plyr::mapvalues(x = subtiss@ident, from = subcluster.ids, to = subcell_ontology_class)
subtiss@meta.data[,'cell_ontology_id'] <- plyr::mapvalues(x = subtiss@ident, from = subcluster.ids, to = subcell_ontology_id)
tiss@meta.data[subtiss@cell.names,'cell_ontology_class'] <- as.character(subtiss@meta.data$cell_ontology_class)
tiss@meta.data[subtiss@cell.names,'cell_ontology_id'] <- as.character(subtiss@meta.data$cell_ontology_id)
TSNEPlot(object = subtiss, do.label = TRUE, pt.size = 0.5, group.by='cell_ontology_class')
Check the numbers of cells per cell_ontology_class
table(tiss@meta.data$cell_ontology_class)
endothelial cell fibroblast erythrocyte endocardial cell
177 222 81 63
cardiac muscle cell Smooth Muscle Cell
60 21
When you save the annotated tissue, please give it a name.
filename = here('00_data_ingest', '04_tissue_robj_generated',
paste0("droplet", tissue_of_interest, "_seurat_tiss.Robj"))
print(filename)
[1] "/Users/guangli/Documents/GitHub/tabula-muris/00_data_ingest/04_tissue_robj_generated/dropletHeart_seurat_tiss.Robj"
save(tiss, file=filename)
# To reload a saved object
# filename = here('00_data_ingest', '04_tissue_robj_generated',
# paste0("facs", tissue_of_interest, "_seurat_tiss.Robj"))
# load(file=filename)
So that Biohub can easily combine all your cell_ontology_classs, please export them as a simple csv.
head(tiss@meta.data)
filename = here('00_data_ingest', '03_tissue_annotation_csv',
paste0(tissue_of_interest, "_droplet_annotation.csv"))
write.csv(tiss@meta.data[,c('channel','cell_ontology_class','cell_ontology_id')], file=filename)